package org.jacp.demo.ui;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextField;

public class test extends JPanel {

    /**
     * Create the panel.
     */
    public test() {
	this.setLayout(new BorderLayout(0, 0));

	JPanel panel = new JPanel();
	panel.setSize(new Dimension(1024, 100));
	this.add(panel, BorderLayout.NORTH);
	GridBagLayout gbl_panel = new GridBagLayout();
	gbl_panel.columnWidths = new int[] { 100, 134, 628, };
	gbl_panel.rowHeights = new int[] { 29, 0 };
	gbl_panel.columnWeights = new double[] { 0.0, 0.0, Double.MIN_VALUE };
	gbl_panel.rowWeights = new double[] { 0.0, Double.MIN_VALUE };
	panel.setLayout(gbl_panel);

	JLabel lblSerachtext = new JLabel("serachtext:");
	GridBagConstraints gbc_lblSerachtext = new GridBagConstraints();
	gbc_lblSerachtext.anchor = GridBagConstraints.EAST;
	gbc_lblSerachtext.insets = new Insets(0, 0, 0, 5);
	gbc_lblSerachtext.gridx = 0;
	gbc_lblSerachtext.gridy = 0;
	panel.add(lblSerachtext, gbc_lblSerachtext);

	JTextField textField = new JTextField();
	GridBagConstraints gbc_textField = new GridBagConstraints();
	gbc_textField.fill = GridBagConstraints.HORIZONTAL;
	gbc_textField.gridwidth = 2;
	gbc_textField.anchor = GridBagConstraints.NORTH;
	gbc_textField.insets = new Insets(0, 0, 0, 5);
	gbc_textField.gridx = 1;
	gbc_textField.gridy = 0;
	panel.add(textField, gbc_textField);
	textField.setColumns(10);

	JButton button = new JButton("New button");
	GridBagConstraints gbc_button = new GridBagConstraints();
	gbc_button.anchor = GridBagConstraints.WEST;
	gbc_button.insets = new Insets(0, 0, 0, 5);
	gbc_button.fill = GridBagConstraints.VERTICAL;
	gbc_button.gridx = 3;
	gbc_button.gridy = 0;
	panel.add(button, gbc_button);
	JFrame f = new JFrame();

	f.setSize(1024, 768);
	f.getContentPane().setLayout(new BorderLayout(0, 0));
	f.getContentPane().add(this, BorderLayout.CENTER);
	JScrollPane scrollPane = new JScrollPane();
	scrollPane.setSize(new Dimension(600, 300));
	this.add(scrollPane);
	f.setVisible(true);
    }

}
